home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
art&graf.ix
/
art-3488
/
macros
/
boltnut.aim
< prev
next >
Wrap
Text File
|
1986-08-03
|
885b
|
25 lines
* Separation of Bolts and Nuts
* (with one nut laying on its side)
*
* A model-directed solution
* (see the chapter "Steps in Image Analysis"
* of "Image Processing - a first introduction",
* a section of the AIM Manual which is available
* at ComMedia, Leidsekade 98, 1017 PP Amsterdam)
*
* Strategy:
* The skeleton of a nut has a vertice resulting
* from the T-form, that of a bolt is a ring or
* a line (for the one on its side).
*
readf IMAGES\BOLTNUT.IM,A
thresh A,B,1,134 * segmentation
inv 1,B * objects should be white
bcopy 1,2,B,B * save a copy in bitplane 2
erosion 1,1,6,0,B * smooth the contours by
dilation 1,1,6,0,B * ..some erosion/dilation
skelet 100,1,0,B * find the skeletons
vertices 1,0,B * only bolts have vertices!
prop 100,1,2,6,0,B * now the bolts in bitplane 1
exor 1,2,3,B * and the nuts in bitplane 3